/**
 * 
 */
package com.aptech.restrant.Model;

import java.io.Serializable;

import java.sql.*;


import org.apache.commons.dbutils.DbUtils;

import ajax.db.DBUtils;
/**
 * @author Administrator
 *
 */
public class FoodBean implements Serializable{
	private int stu_ID;
	private String stu_name=null;
	private String stu_pass;
	private String xueyuan;
	private String banji;
	private int software;
	private int uml;
	private int snl;
	
	public FoodBean() {
		super();
	}
	
	public FoodBean(int stu_ID, String stu_name, String xueyuan,
			 String banji, int software,int uml,int snl) {
		super();
		this.stu_ID = stu_ID;
		this.stu_name = stu_name;
		this.xueyuan = xueyuan;
		this.banji = banji;
		this.software = software;
		this.uml = uml;
		this.snl = snl;
	}
	
	public FoodBean(int stu_ID){
		String sql="select stu_ID,stu_name,xueyuan,banji,software,uml,snl from stuInfo where stu_ID=?";
		Connection conn=null;
		PreparedStatement pstmt=null;
		ResultSet rs=null;
		try{
			conn=DBUtils.getConnnection();
			pstmt=conn.prepareStatement(sql);
			pstmt.setInt(1,stu_ID);
			
			rs=pstmt.executeQuery();
			if(rs.next()){
				this.stu_ID=rs.getInt(1);
				this.stu_name=rs.getString(2);
				this.xueyuan=rs.getString(3);
			}
			
		}catch(SQLException e){
			System.out.println(e.toString());
		}
		finally{
			DBUtils.close(rs);
			DBUtils.close(pstmt);
			DBUtils.close(conn);
		}
	}
	/**
	 * @return the foodID
	 */
	public int getstu_ID() {
		return stu_ID;
	}
	/**
	 * @param foodID the foodID to set
	 */
	public void setstu_ID(int stu_ID) {
		this.stu_ID = stu_ID;
	}
	/**
	 * @return the foodName
	 */
	public String getstu_name() {
		return stu_name;
	}
	/**
	 * @param foodName the foodName to set
	 */
	public void setstu_name(String stu_name) {
		this.stu_name = stu_name;
	}
	
	public String getstu_pass() {
		return stu_pass;
	}
	/**
	 * @param foodName the foodName to set
	 */
	public void setstu_pass(String stu_pass) {
		this.stu_pass = stu_pass;
	}
	
	/**
	 * @return the remark
	 */
	public String getxueyuan() {
		return xueyuan;
	}
	/**
	 * @param remark the remark to set
	 */
	public void setxueyuan(String xueyuan){
		this.xueyuan = xueyuan;
	}
	/**
	 * @return the foodPrice
	 */
	public String getbanji() {
		return banji;
	}
	/**
	 * @param foodPrice the foodPrice to set
	 */
	public void setbanji(String banji) {
		this.banji = banji;
	}
	/**
	 * @return the foodImage
	 */
	public int getsoftware() {
		return software ;
	}
	/**
	 * @param foodImage the foodImage to set
	 */
	public void setsoftware(int software) {
		this.software  = software ;
	}
	public int getuml() {
		return uml;
	}
	/**
	 * @param foodImage the foodImage to set
	 */
	public void setuml(int uml) {
		this.uml = uml;
	}
	public int getsnl() {
		return snl;
	}
	/**
	 * @param foodImage the foodImage to set
	 */
	public void setsnl(int snl) {
		this.snl = snl;
	}
	
	
}
